package com.group2.view;
import static model.netBase.IP;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import model.*;
public class StudentMainFrame_Admin extends JFrame {
	// 声明对象
	// public JFrame index;
	//private JB management;
	//private JMenu students;
	//JFrame jf=new JFrame();
	JLabel icon = new JLabel();
	private JButton studentsadd= new JButton("学生添加");
	private JButton studentshow=new JButton("学生信息查看");
	JPanel panel = new JPanel(null);// 第一个JPanel
	Font f = new Font("黑体", Font.BOLD, 15);

	// 构造函数
	public StudentMainFrame_Admin() {
		init();

	}

	private void init() {
		// 初始化框架
		this.setTitle("欢迎管理员来到学籍管理系统！");
		this.setSize(530, 500);
		this.setResizable(false);
		studentsadd.setFont(f);
		studentsadd.setFocusPainted(false);
		studentshow.setFont(f);
		studentshow.setFocusPainted(false);
		studentsadd.setIcon(new javax.swing.ImageIcon(UserLogOnFrame.class.getResource("/images/Stuadd.png")));
		studentshow.setIcon(new javax.swing.ImageIcon(UserLogOnFrame.class.getResource("/images/Stumod.png")));
		// 设置框架大小及位置
		icon.setBounds(155,63,250,190);
		icon.setIcon(new javax.swing.ImageIcon(UserLogOnFrame.class.getResource("/images/学生档案.png")));
		
		studentsadd.setBounds(80, 270, 150, 40);
		studentsadd.setFont(f);
		studentsadd.setBorderPainted(false);
		studentshow.setBounds(260, 270, 180, 40);
		studentshow.setFont(f);
		studentshow.setBorderPainted(false);
		
		panel.setBounds(0, 0, 500, 500);

		panel.add(icon);
		panel.add(studentsadd);
		panel.add(studentshow);	
		this.getContentPane().add(panel);
		this.setVisible(true);
		// 居中显示
		this.setLocationRelativeTo(null);
		studentsadd.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				// 界面转换
				new StudentAddFrame();
			}
		});

		studentshow.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) { // 界面转换				
				new StudentShowFrame();
			}
		});
	}


	public static void main(String[] args) {
		new StudentMainFrame_Admin();
	}
}